package com.binance.gateway.util;

import java.util.Map;

public class StringUtil {

    public static String buildGetParamStr(Map<String, ?> params){
        if (params==null || params.isEmpty()){
            return "";
        }
        StringBuilder sb = new StringBuilder("?");
        params.forEach((k, v)->{
            if (k!=null && v!=null){
                sb.append(k).append("=").append(v).append("&");
            }
        });
        if (sb.length()==1){
            return "";
        }
        return sb.toString();
    }

}
